<?php
abstract class abstract_user {
 
    protected $status = 0;
    protected $user_id = null;
    protected $user_group_id = null;

    protected $username;
    protected $password;
    protected $salt;

    protected $email;
    protected $firstname;
    protected $lastname;

    protected $date_added;
    
    protected $ip;
    protected $code;

    public function login($username, $password) {

        $password = sha1($this->salt . sha1($this->salt . sha1($password)));

        if($this->username == $username && $this->password == $password) {
            return true;
        }
        return false;
    }

    public function get_status() {
        return $this->status;
    }

    public function get_id() {
        return $this->user_id;
    }

    public function get_group_id() {
        return $this->user_group_id;
    }

    public function get_username() {
        return $this->username;
    }	

    public function get_email() {
        return $this->email;
    }

    public function get_firstname() {
        return $this->firstname;
    }

    public function get_lastname() {
        return $this->lastname;
    }

    public function get_local_code() {
        return $this->code;
    }

    public function get_date_added(){
        return $this->date_added;
    }
}
?>
